#!/usr/bin/env python
# -*- coding:utf-8 -*-
import base
from web import models
import datetime
# 往数据库添加数据：链接数据库、操作、关闭链接
# models.UserInfo.objects.create(username='dpp', email='chengshuo@live.com',
# mobile_phone='13838383838', password=md5('1111'))
# models.PriceStrategy.objects.create(
#             category = '免费版',
#             title = '个人免费版',
#             price = 0,
#             project_num = 3,
#             group_num=2,
#             space = 20*1024*1024,
#             file_size = 5*1024*1024,
#             create_date = datetime.datetime.now()
            
# )

print('hi')
print(__name__)
# models.TransactionRecord.objects.filter(id=1).delete()
def init_filerepository():
    pass
    # models.FileRepository.objects.create(
    #     project_id = 9,
    #     name = '菊花台',
    #     parent_id = 1,
    #     file_type = 2,
    #     update_user_id = 2)
    
    # models.FileRepository.objects.create(
    #     project_id = 9,
    #     name = '七里香',
    #     parent_id = 1,
    #     file_type = 2,
    #     update_user_id = 2)
    
    # models.FileRepository.objects.create(
    #     project_id = 9,
    #     name = '4.jfif',
    #     parent_id = 19,
    #     file_type = 1,
    #     file_size = 95375,
    #     key = '4.jfif',
    #     update_user_id = 2) 

    models.FileRepository.objects.create(
        project_id = 9,
        name = '3.jfif',
        parent_id = 23,
        file_type = 1,
        file_size = 61388,
        key = '3.jfif',
        update_user_id = 2) 


def init_IssueType():
    models.IssuesType.objects.create(
        title = '任务',
        project_id = 9,
        ) 
    models.IssuesType.objects.create(
        title = '功能',
        project_id = 9,
        ) 

def init_Issues_Attention():
    models.Issues_.objects.create(
        reply_type = 1,
        issues_id = 2,
        content= 'modify record 1',
        creator_id = 2,
        create_datetime =datetime.datetime.now()
        )  

def init_IssueReply():
    # models.IssuesReply.objects.create(
    #     reply_type = 1,
    #     issues_id = 2,
    #     content= 'modify record 1',
    #     creator_id = 2,
    #     create_datetime =datetime.datetime.now()
    #     )    
    
    models.IssuesReply.objects.create(
        reply_type = 1,
        issues_id = 2,
        content= 'modify record 1',
        creator_id = 2,
        create_datetime =datetime.datetime.now(),
        reply_id = 1
        )    


if __name__ == '__main__':
    # init_filerepository()
    # init_IssueType()
    init_IssueReply()
    print('Done!')